﻿// <copyright file="GameLogicWebModule.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the GameLogicWebModule</summary>

namespace Sqwarea.GameLogic
{
    using Autofac.Builder;
    using Sqwarea.GameLogic.TopList;
    using Sqwarea.GameLogic.View;

    /// <summary>
    /// Autofac module for registering GameLogic class for Web Role
    /// </summary>
    public class GameLogicWebModule : Module
    {
        /// <summary>
        /// WARNING : Need Persistence classes.
        /// Registers GameLogic classes for Web Role.
        /// </summary>
        /// <param name="moduleBuilder">See Autofac documentation.</param>
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            moduleBuilder.Register<TopListProvider>().As<ITopListProvider>().SingletonScoped();
            moduleBuilder.Register<UserStarter>().As<IUserStarter>().SingletonScoped();
            moduleBuilder.Register<KingManager>().As<IKingManager>().ContainerScoped();
            moduleBuilder.Register<MapViewer>().As<IMapViewer>().ContainerScoped();
            moduleBuilder.Register<LogViewer>().As<ILogViewer>().ContainerScoped();
            moduleBuilder.Register<UserStarter>().As<IUserStarter>().ContainerScoped();
        }
    }
}
